#include "logger/Appender.h"
#include <iostream>

void ConsoleAppender::log(int level, String message, ...) {
	std::cout << message << std::endl;
}

TestAppender::TestAppender()
: lastMessage(0)
  {}

void TestAppender::log(int level, String message, ...) {
	if (lastMessage != 0) free (lastMessage);
	lastMessage = (char*)calloc(strlen (message), sizeof(char));
	strcpy (lastMessage, message);
	//std::cout << message << std::endl;
}

String TestAppender::getLastMessage () {
	return this->lastMessage;
}
